﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FoundationLib.Ifc.DependencyInjection.Configuration
{
	/// <summary>
	/// Represents an IOC container configuration element.
	/// </summary>
	public class IocConfigElement : ConfigurationElement
	{
		/// <summary>
		/// Gets or sets the name of the container implementation.
		/// </summary>
		[ConfigurationProperty("name", IsKey = true, IsRequired = true)]
		public string Name
		{
			get
			{
				return this["name"] as string;
			}
		}

		/// <summary>
		/// Gets a flag indicating whether this container is the default.
		/// </summary>
		[ConfigurationProperty("default", IsRequired = false, DefaultValue = false)]
		public bool IsDefault
		{
			get
			{
				return ((bool)this["default"]);
			}
		}

		/// <summary>
		/// Gets the fully-qualified name of the class implementing the <see cref="IIocContainer"/> interface.
		/// </summary>
		[ConfigurationProperty("implementation", IsRequired = true)]
		public string Implementation
		{
			get
			{
				return this["implementation"] as string;
			}
		}

		/// <summary>
		/// Creates a new <see cref="IocConfigElement"/> instance.
		/// </summary>
		public IocConfigElement()
			: base()
		{
		}
	}
}
